function mf = flipud(m)
  mf = zeros(m);
  len = size(m,1)
  for i = 1:len
    mf(len+1-i, :) = m(i,:);
  end
endfunction
